<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tern/tern-tags.tld" prefix="tern"%>
<tern:page pageForm="admin.StudentPage">
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>学生信息</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<link href="${applicationScope.root}js/toolbar/toolbar.css"
	rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${applicationScope.root}skins/default/main.css">
<link type="text/css"
	href="${applicationScope.root}js/themes/ui-lightness/jquery.ui.all.css"
	rel="stylesheet" />
<script type="text/javascript"
	src="${applicationScope.root}js/jquery.min.js"></script>
<script type="text/javascript"
	src="${applicationScope.root}js/toolbar/toolbar.js"></script>
<script type="text/javascript"
	src="${applicationScope.root}js/ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="${applicationScope.root}js/util.js"></script>
<script language="javascript">
$(function() {
	$("#toolbar1").commonBar(
			{
				rootPath : '${applicationScope.root}js/toolbar/',
				commandClick : function(cmd) {
					var id = firstChecked('stuID');		
					if (cmd == "new") {
						openDialog('studentEdit.jsp?time=' + (new Date()).getTime(),"studentEdit", 400,400,440,100);
					} else if (cmd == 'modify') {
						if (id == null) {
							alert('您没有选中任何数据!');
							return;
						} else {
							openDialog('studentEdit.jsp?id=' + id + '&time='+ (new Date()).getTime(),"studentEdit",400,400,440,100);
						}
					} else if (cmd == 'import') {		
						openDialog('../admin/importStudentExcel.jsp?time='+ (new Date()).getTime(),"importStudentExcel",400,400,440,100);

					}else if (cmd == "export") {
						var rootDir = "${page.webSite}${applicationScope.root}";
						var url=rootDir+'stuExcel.jsp?time='+ (new Date()).getTime();
						openExcel(url); 
						
					}else if (cmd == "del") {
						if (id == null) {
							alert('您没有选中任数据!');
							return;
						} else {
							askYesOrNo({
								message : '您确实要删除选中的数据吗？',
								onok : function() {
									$('#myForm').onevent('onDel', id);
								}
							});
						}
					}
				}
			});
});
</script>
<style type="text/css">
body {
	margin: 0px 8px 8px;
}
</style>
</head>
<body>
	<tern:form method="post" id="myForm">
		 <ul id="toolbar1">
  		<li>-</li><li>-</li>
		<li style="width: 100px"><img
			src="${applicationScope.root}skins/common/icon_new.png" /> <a
			href='#new'>新建</a>
		</li>
		 
		<li style="width: 100px"><img
			src="${applicationScope.root}skins/common/bt_edit.png" /> <a
			href='#modify'>修改</a>
		</li>
		 
		<li style="width: 100px"><img
			src="${applicationScope.root}skins/common/bt_del.png" /> <a
			href='#del'>删除</a>
		</li>
		
		<li style="width: 105px"><img
			src="${applicationScope.root}skins/common/bt_model.png" /> <a
			href='#export'>EXCEL模板</a>
		</li>
		<li style="width: 100px"><img
			src="${applicationScope.root}skins/common/bt_x.png" />
		<a href='#import'>批量导入</a>
		</li>
	</ul>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>  
        <td>         
           <div class="title"><span>当前位置：</span>学生管理 &gt; 学生信息</div> 
           </td>         
        </tr>         
      </table>	
		<tern:table id="enTable" dataSource="${page.students}">
			<tern:theader>
				<tern:tcell width="75" height="24" align="center">选择</tern:tcell>
				<tern:tcell align="center">学号</tern:tcell>
				<tern:tcell align="center">姓名</tern:tcell>
				<tern:tcell align="center">性别</tern:tcell>
				<tern:tcell align="center">专业 </tern:tcell>
				<tern:tcell align="center">电话 </tern:tcell>
				<tern:tcell align="center">邮箱</tern:tcell>
				<tern:tcell align="center">备注 </tern:tcell>
			</tern:theader>
			<tern:trow>
				<tern:tcell height="22" align="center">
				<input value='${item.stuID}' name="stuID" type="radio" />
				</tern:tcell>
				<tern:tcell>&nbsp;${item.stuNum}</tern:tcell>
				<tern:tcell>&nbsp;${item.stuName}</tern:tcell>
				<tern:tcell>&nbsp;${item.sex}</tern:tcell>
				<tern:tcell>&nbsp;${item.major}</tern:tcell>
				<tern:tcell>&nbsp;${item.stuPhone}</tern:tcell>
				<tern:tcell>&nbsp;${item.stuMail}</tern:tcell>
				<tern:tcell>&nbsp;${item.remarks}</tern:tcell>
			</tern:trow>
		</tern:table>
		<input name="b_refreah" type="button" value="刷新" style="display: none"
			onClick="on_event('onRefresh','')" />
	</tern:form>
</body>
	</html>
</tern:page>
